<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : order.xsl
    Created on : November 24, 2012, 1:31 PM
    Author     : Administrator
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output method="xml" indent = "yes"/>
    <xsl:param name="OrderFileName"/>
    <xsl:template match="/">
        <fo:root>
            <fo:layout-master-set>
                <fo:simple-page-master master-name="A4-portrait"
                    page-height="29.7cm" page-width="21.0cm" margin="0.5cm">
                    <fo:region-body margin-top="2in"/>
                    <fo:region-before margin-top="2in"/>
                    <fo:region-after extent="0.75in"/>
                </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="A4-portrait">
                <fo:static-content flow-name="xsl-region-before">
                    <fo:block font-size="50pt" font-family="sans-serif"
                    line-height="60pt" background-color="cyan" text-align="center">
                        <fo:external-graphic src="url('https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash4/203056_100000771316451_1552799485_q.jpg')"/>
                        ORDER
                    </fo:block>
                </fo:static-content>
                <fo:flow flow-name='xsl-region-body'>
                    <fo:block font-size="15pt" linefeed-treatment="preserve">
                        <xsl:for-each select="document($OrderFileName)">
                            
                            <fo:inline font-weight="bold">OrderID:</fo:inline>
                            <fo:inline font-weight="bold" color="red">
                                <xsl:value-of select="/Order/OrderId"/>&#xA;
                            </fo:inline>
                            <xsl:text>&#xA;</xsl:text>
                            <fo:inline font-weight="bold">Name:</fo:inline>
                            <fo:inline font-weight="bold" color="red">
                                <xsl:value-of select="/Order/Name"/>
                            </fo:inline>
                            <xsl:text>&#xA;</xsl:text>
                            <fo:inline font-weight="bold">Address:</fo:inline>
                            <fo:inline font-weight="bold" color="red">
                                <xsl:value-of select="Order/Address"/>
                            </fo:inline>
                            <xsl:text>&#xA;</xsl:text>
                            <fo:inline font-weight="bold">Order Date:</fo:inline>
                            <fo:inline font-weight="bold" color="red">
                                <xsl:value-of select="Order/OrderTime"/>
                            </fo:inline>
                            <xsl:text>&#xA;</xsl:text>
                        </xsl:for-each>
                        <fo:table border-collapse="separate" border-style="solid">
                            <fo:table-column column-width="50mm"/>
                            <fo:table-column column-width="80mm"/>
                            <fo:table-column column-width="20mm"/>
                            <fo:table-column column-width="20mm"/>
                            <fo:table-column column-width="30mm"/>

                            <fo:table-header>
                                <fo:table-row>
                                    <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                        <fo:block font-weight="bold">Isbn</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                        <fo:block font-weight="bold">Title</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                        <fo:block font-weight="bold">Quantity</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                        <fo:block font-weight="bold">Price</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                        <fo:block font-weight="bold">Sub Total</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-header>
                            <fo:table-body>
                                <xsl:for-each select="/OrderDetails/OrderDetail">
                                    <fo:table-row>
                                        <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                            <fo:block>
                                                <xsl:value-of select="Isbn" />
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                            <fo:block>
                                                <xsl:value-of select="Title" />
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                            <fo:block>
                                                <xsl:value-of select="Quantity" />
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                            <fo:block>
                                                <xsl:value-of select="Price" />
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell border-color="blue" border-width="0.5pt" border-style="solid">
                                            <fo:block>
                                                <xsl:value-of select="SubTotal" />
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>
                                </xsl:for-each>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                    <fo:block font-weight="bold">
                        Total:
                    </fo:block>
                    <fo:block>
                        All materials on this website are the copyright of ICC Services/ Publications and/or International Chamber of Commerce (ICC) as defined by the French Code of Intellectual Property.  All rights are reserved. The materials on this website may be retrieved and downloaded solely for personal use. No materials may otherwise be reproduced, copied, translated, modified, published, broadcast or otherwise distributed or adapted in any form or by any means without the prior written permission of ICC through ICC Services/ Publications.
                        For information about reproduction or adaption of any of ICC's texts, in part or in whole, please contact us at pub@iccwbo.org.
                            ICC, the ICC logo, CCI, the CCI logo, International Chamber of Commerce, World Business Organization, WBO, International Court of Arbitration, ICC International Court of Arbitration (including Spanish, French, German and Arabic translations), World Chambers Federation, WCF, World Chambers Network, WCN, Incoterms and DC-Pro are all ICC's registered trademarks.

UCP 500, UCP 600, Incoterms, Institute of World Business Law and ICC eTerms are also trademarks of ICC.
                    </fo:block>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

</xsl:stylesheet>


